import requests
import httpx
headers = {
    "User-Agent": "yuanrenxue.project",
    'Cookie': 'sessionid=84rfzmmclgdvknl834a394ole9kmxdmk'
}
url = 'https://match.yuanrenxue.com/api/match/17?page={page}'
# client = httpx.Client(http2=True)  # 类似与requests的session
# response = client.get(url, headers=headers)
# print(response.text)
client=httpx.Client(http2=True,verify=False,headers=headers)
all_sum=0
for page in range(1,6):
    response=client.get(url.format(page=page)).json()
    sum_value=0
    for da in response.get('data'):
        sum_value+=da.get('value')
    print(f'第{page}的和为',sum_value)
    all_sum+=sum_value
print(f'{page}总和为',all_sum)
